<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:70px;
		}
	</style>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span9" >
				<div class="clear"></div>
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
					<li class="active">
						<a href="project.html"><i class="icon-fire"></i>想法</a>
					</li>
					<li style="float:right"><i class="icon-plus"></i><a href="idea.jspx?imethod=new" class="link-black">发表想法</a></li>
				</ul>
				
				<c:choose>
					<c:when test="${empty requestScope.userIdeaList.list}">
						<div>此项目还没有发表任何想法</div>
					</c:when>
					<c:otherwise>
					
						<div class="wall" style="border-top:none; border:1px solid #dddddd ">
							<c:forEach items ="${requestScope.userIdeaList.list}" var ="useridea">
								<div style="margin:20px">						
									<blockquote>
									<div><a href="idea.jspx?imethod=tocomment&id=${useridea.idea.id}"><h4>${useridea.idea.title }</h4></a></div>
										  <p style="font-size:14px">${useridea.idea.content}</p>
										  <small>${useridea.user.username}${useridea.idea.createtime}&nbsp;&nbsp;&nbsp;&nbsp;<a href="idea.jspx?imethod=tocomment&id=${useridea.idea.id}">[我要评论]</a></small>
										  <c:if test="${ useridea.user.id == requestScope.userid}">
										  	<c:choose>
											  	<c:when test="${useridea.result == 0}">
											  	</c:when>
											  	<c:otherwise>
											  		<div style="margin-top:2px"><p><a href="idea.jspx?imethod=edit&id=${useridea.idea.id}" ><i class="icon-pencil"></i></a><a href="idea.jspx?code=1008&id=${useridea.idea.id}" ><i class="icon-trash"></i></a></div>
											  		<c:choose>
												  		<c:when test="${param.code == 1008}">
												  		<div class = "modal show "  id="mymodal" style = "width:400px">
												  			<div style="margin-left:10px">删除文件</div>
															<div class = "modal-body" style = "text-align:center;height:20px;margin-top:10px">
																	<div >删除后将无法恢复，您确定要删除此想法吗？</div>		
															</div>
															<div class = "modal-footer">
																<a href="idea.jspx?imethod=delete&id=${useridea.idea.id}" class = "btn btn-primary" >是</a>
																<a href="idea.jspx" class = "btn " >否</a>
															</div>
														</div>
														</c:when>
													</c:choose>
											  	</c:otherwise>
										  	</c:choose>
										  </c:if>
									</blockquote>						
								</div>
							</c:forEach>
							<div style ="clear:both"></div>                                                                                                                                                                                                             	
									<div style="margin-top:2px;margin-right:10px"  class="pagination pull-right">
								 <ul>
								<c:choose>
									<c:when test="${ requestScope.userIdeaList.totalPage == 1}">
										
									</c:when>
									<c:when test="${ requestScope.userIdeaList.totalPage > 1}">
										<c:choose>
										<c:when test="${userIdeaList.pageNum == 1}">
											<li><a href="#">Prev</a></li>
											<li class = "active"><a>1</a></li>
											<li ><a href = "idea.jspx?p=2">2</a></li>
											<li><a>...</a></li>	
											<li><a href="#">Next</a></li>			
										</c:when>
										<c:when test="${userIdeaList.pageNum == 2}">
											<li><a href="idea.jspx?p=${userIdeaList.pageNum-1}">Prev</a></li>
											<li ><a href = "idea.jspx?p=1">1</a></li>
											<li class = "active"><a href = "idea.jspx?p=2">2</a></li>
											<li><a>...</a></li>
											<c:choose>
											<c:when test="${userIdeaList.pageNum == userIdeaList.totalPage }">
												<li><a href="#">Next</a></li>
											</c:when>
											<c:otherwise>
												<li><a href="idea.jspx?p=${userIdeaList.pageNum+1}">Next</a></li>
											</c:otherwise>
											</c:choose>				
										</c:when>	
										<c:when test="${userIdeaList.pageNum > 2}">
											<li><a href="idea.jspx?p=${userIdeaList.pageNum-1}">Prev</a></li>
											<li ><a href = "idea.jspx?p=1">1</a></li>
											<li ><a href = "idea.jspx?p=2">2</a></li>
											<li><a>...</a></li>	
											<li class = "active"><a >${userIdeaList.pageNum}</a></li>
											<c:choose>
											<c:when test="${userIdeaList.pageNum == userIdeaList.totalPage }">
												<li><a href="#">Next</a></li>
											</c:when>
											<c:otherwise>
												<li><a href="idea.jspx?p=${userIdeaList.pageNum+1}">Next</a></li>
											</c:otherwise>
											</c:choose>		
										</c:when>	
										</c:choose>	
									</c:when>
								</c:choose>	
								<li><a>共${userIdeaList.totalPage}页</a></li>
								</ul></div>	
							</div>
							
					</c:otherwise>	
					</c:choose>	
			</div>			
		</div>
		
</div>	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(7).addClass("active");
			$("#myid i").eq(5).addClass("  icon-white");
		});
		
	</script>
</body>
</html>